import 'package:flutter/material.dart';

class CusSpacer extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        BlueBox(),
        Spacer(
          flex: 2
        ),
        BlueBox(),
        // 占领剩余的空间，使用flex属性，(学到此处，暂时无child属性)
        // 若有多个Spacer，则使用份数确定占领空间的大小
        Spacer(
          flex: 1,
        ),
        BlueBox()
      ],
    );
  }
}

class BlueBox extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 50,
      height: 50,
      decoration: BoxDecoration(
        color: Colors.amber,
        border: Border.all()
      )
    );
  }
}